package controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import service.PlayerBusiness;
import service.ServiceFactory;

@Controller
public class ListInfoTransfer {

	private PlayerBusiness playerBusiness = ServiceFactory.getPlayBusiness();

	@ResponseBody
	@RequestMapping(value = "/addSongInList/{songId}/{slistId}", method = {
			RequestMethod.GET }, produces = "application/json;charset=UTF-8")
	public String addSongInList(@PathVariable("songId") int songId, @PathVariable("slistId") int slistId) {
		String json = playerBusiness.addSongInList(songId, slistId);
		return json;
	}

	@ResponseBody
	@RequestMapping(value = "/deleteSongInList/{songId}/{slistId}", method = {
			RequestMethod.GET }, produces = "application/json;charset=UTF-8")
	public String deleteSongInList(@PathVariable("songId") int songId, @PathVariable("slistId") int slistId) {
		String json = playerBusiness.deleteSongInList(songId, slistId);
		return json;
	}

}
